<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../../commons/taglibs.jsp"%>
<%@ include file="../../commons/list.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta charset="utf-8">
  <title>车详情基本信息</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <style type="text/css">
  	.layui-input{
  		width: 280px;
  	}
  	.layui-form-pane .layui-form-label{
  		width: 180px;
  	}
  </style>
</head>

<body>

<div>
	<div style="padding: 50px;padding-top: 10px">
		<form class="layui-form layui-form-pane"  action="">
			<input type="hidden" id='entityId' name='entityId' value="${carDetailEngine.id }">
			<input type="hidden" name='carmodelid' value="${carmodelid }">
			
	   		 <div class="layui-form-item">
			     <label class="layui-form-label">发动机型号</label>
			     <div class="layui-input-inline">
			         <input type="text" name="model" id='model' placeholder="请输入发动机型号" value="${carDetailEngine.model }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">排量(mL)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="displacement" id='displacement' placeholder="请输入排量(mL)" value="${carDetailEngine.displacement }" class="layui-input">
			     </div>
			 </div>
			 
			  <div class="layui-form-item">
			     <label class="layui-form-label">进气形式</label>
			     <div class="layui-input-inline">
			         <input type="text" name="intakeform" id='intakeform' placeholder="请输入进气形式" value="${carDetailEngine.intakeform }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">气缸排列形式</label>
			     <div class="layui-input-inline">
			         <input type="text" name="cylinderexhaustform" id='cylinderexhaustform' placeholder="请输入气缸排列形式" value="${carDetailEngine.cylinderexhaustform }" class="layui-input">
			     </div>
			 </div>
			 
			  <div class="layui-form-item">
			     <label class="layui-form-label">气缸数(个)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="cylinders" id='cylinders' placeholder="请输入气缸数(个)" value="${carDetailEngine.cylinders }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">每缸气门数(个)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="valvepercylinder" id='valvepercylinder' placeholder="请输入轴距(mm))" value="${carDetailEngine.valvepercylinder }" class="layui-input">
			     </div>
			 </div>
			 
			  <div class="layui-form-item">
			     <label class="layui-form-label">气缸数(个)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="cylinders" id='cylinders' placeholder="请输入气缸数(个)" value="${carDetailEngine.cylinders }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">每缸气门数(个)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="valvepercylinder" id='valvepercylinder' placeholder="请输入轴距(mm))" value="${carDetailEngine.valvepercylinder }" class="layui-input">
			     </div>
			 </div>
			 
			 <div class="layui-form-item">
			     <label class="layui-form-label">压缩比</label>
			     <div class="layui-input-inline">
			         <input type="text" name="compressionratio" id='compressionratio' placeholder="请输入压缩比" value="${carDetailEngine.compressionratio }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">配气机构</label>
			     <div class="layui-input-inline">
			         <input type="text" name="gasdistrbutionmechanism" id='gasdistrbutionmechanism' placeholder="请输入配气机构" value="${carDetailEngine.gasdistrbutionmechanism }" class="layui-input">
			     </div>
			 </div>
			 
			  <div class="layui-form-item">
			     <label class="layui-form-label">缸径(mm)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="cylinderby" id='cylinderby' placeholder="请输入缸径(mm)" value="${carDetailEngine.cylinderby }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">行程(mm)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="trip" id='trip' placeholder="请输入行程(mm)" value="${carDetailEngine.trip }" class="layui-input">
			     </div>
			 </div>
			 
			 <div class="layui-form-item">
			     <label class="layui-form-label">最大马力(Ps)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="maxhorsepower" id='maxhorsepower' placeholder="请输入最大马力(Ps)" value="${carDetailEngine.maxhorsepower }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">最大功率(kW)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="maxpower" id='maxpower' placeholder="请输入最大功率(kW)" value="${carDetailEngine.maxpower }" class="layui-input">
			     </div>
			 </div>
			 
			  <div class="layui-form-item">
			     <label class="layui-form-label">最大马力(Ps)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="maxpowerspeed" id='maxpowerspeed' placeholder="请输入最大功率转速(rpm)" value="${carDetailEngine.maxpowerspeed }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">最大扭矩(N·m)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="maxtorque" id='maxtorque' placeholder="请输入最大扭矩(N·m)" value="${carDetailEngine.maxtorque }" class="layui-input">
			     </div>
			 </div>
			 
		   	 <div class="layui-form-item">
			     <label class="layui-form-label">最大扭矩转速(rpm)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="maxtorquespeed" id='maxtorquespeed' placeholder="请输入最大扭矩转速(rpm)" value="${carDetailEngine.maxtorquespeed }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">发动机特有技术</label>
			     <div class="layui-input-inline">
			         <input type="text" name="specialtechnology" id='specialtechnology' placeholder="请输入发动机特有技术" value="${carDetailEngine.specialtechnology }" class="layui-input">
			     </div>
			 </div>
			 
		  	 <div class="layui-form-item">
			     <label class="layui-form-label">最大扭矩转速(rpm)</label>
			     <div class="layui-input-inline">
			         <input type="text" name="maxtorquespeed" id='maxtorquespeed' placeholder="请输入最大扭矩转速(rpm)" value="${carDetailEngine.maxtorquespeed }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">发动机特有技术</label>
			     <div class="layui-input-inline">
			         <input type="text" name="specialtechnology" id='specialtechnology' placeholder="请输入发动机特有技术" value="${carDetailEngine.specialtechnology }" class="layui-input">
			     </div>
			 </div>
			 
			 <div class="layui-form-item">
			     <label class="layui-form-label">燃料形式</label>
			     <div class="layui-input-inline">
			         <input type="text" name="fuelform" id='fuelform' placeholder="请输入燃料形式" value="${carDetailEngine.fuelform }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">燃油标号</label>
			     <div class="layui-input-inline">
			         <input type="text" name="fuel" id='fuel' placeholder="请输入燃油标号" value="${carDetailEngine.fuel }" class="layui-input">
			     </div>
			 </div>
			 
			 <div class="layui-form-item">
			     <label class="layui-form-label">供油方式</label>
			     <div class="layui-input-inline">
			         <input type="text" name="fuleway" id='fuleway' placeholder="请输入供油方式" value="${carDetailEngine.fuleway }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">缸盖材料</label>
			     <div class="layui-input-inline">
			         <input type="text" name="cylinderheadmeterial" id='cylinderheadmeterial' placeholder="请输入缸盖材料" value="${carDetailEngine.cylinderheadmeterial }" class="layui-input">
			     </div>
			 </div>
			 
			 <div class="layui-form-item">
			     <label class="layui-form-label">缸体材料</label>
			     <div class="layui-input-inline">
			         <input type="text" name="cylindermaterial" id='cylindermaterial' placeholder="请输入缸体材料" value="${carDetailEngine.cylindermaterial }" class="layui-input">
			     </div>
			     
			     <label class="layui-form-label">环保标准</label>
			     <div class="layui-input-inline">
			         <input type="text" name="environmentalprotection" id='environmentalprotection' placeholder="请输入环保标准" value="${carDetailEngine.environmentalprotection }" class="layui-input">
			     </div>
			 </div>
			 
		  <div class="layui-form-item" style="width: 85%;padding-left: 150px;padding-top: 30px">
		    <div class="layui-input-block">
		      <button class="layui-btn" id='tjsub' lay-submit lay-filter="formDemo">立即提交</button>
		    </div>
		  </div>
		</form>
	</div>
 </div>
<script>

layui.use(['form'], function () {
    var $ = layui.jquery
        ,form = layui.form
        ,layer= layui.layer;
    
     var form = layui.form;
	  
	  //监听提交
	  form.on('submit(formDemo)', function(data){
		  var field = JSON.parse(JSON.stringify(data.field));
		  var img = field.img;
		  field.img = $("#imgAddress").val();
	  	//提交成功后禁用按钮
		$("#tjsub").css("pointer-events","none"); 
	    //layer.msg(JSON.stringify(data.field));
	    $.post("<%=basePath%>/controller/carDetailEngine/save",field,function (data){
	    	if(data == '0'){
	    		$("#tjsub").css("pointer-events","auto");
	    		layer.msg('提交成功', {time:1000}); 
	    		setTimeout("window.location.reload();",1500); 
	    	}else{
	    		$("#tjsub").css("pointer-events","auto");
	    		layer.msg('提交失败', {time:1000}); 
	    	}
	    })
	    return false;
	  });
    
});

</script>
</body>
</html>
